<?php

namespace fast;

use EasyWeChat\Factory;

class WechatApp
{
    protected $config = [
        'app_id' => 'wxd5fb699c0efc51eb',
        'secret' => '6f72523f04bb192e879acac4f1e61b5e',
    ];

    protected $app;

    public function __construct()
    {
        // 初始化微信小程序
        $this->app = Factory::miniProgram($this->config);
    }

    public function getApp()
    {
        return $this->app;
    }

    public function getConfig()
    {
        return $this->config;
    }

    // 登录
    public function login($code)
    {
        return $this->app->auth->session($code);
    }

}